/**
 * <copyright>
 * </copyright>
 *

 */
package br.ufrn.dimap.processDsl.impl;

import br.ufrn.dimap.processDsl.Artifact;
import br.ufrn.dimap.processDsl.ArtifactElement;
import br.ufrn.dimap.processDsl.ProcessDslPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Artifact Element</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.ufrn.dimap.processDsl.impl.ArtifactElementImpl#getArtifacts <em>Artifacts</em>}</li>
 *   <li>{@link br.ufrn.dimap.processDsl.impl.ArtifactElementImpl#getPinType <em>Pin Type</em>}</li>
 *   <li>{@link br.ufrn.dimap.processDsl.impl.ArtifactElementImpl#getVariability <em>Variability</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ArtifactElementImpl extends MinimalEObjectImpl.Container implements ArtifactElement
{
  /**
   * The cached value of the '{@link #getArtifacts() <em>Artifacts</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getArtifacts()
   * @generated
   * @ordered
   */
  protected Artifact artifacts;

  /**
   * The default value of the '{@link #getPinType() <em>Pin Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPinType()
   * @generated
   * @ordered
   */
  protected static final String PIN_TYPE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getPinType() <em>Pin Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getPinType()
   * @generated
   * @ordered
   */
  protected String pinType = PIN_TYPE_EDEFAULT;

  /**
   * The default value of the '{@link #getVariability() <em>Variability</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVariability()
   * @generated
   * @ordered
   */
  protected static final String VARIABILITY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getVariability() <em>Variability</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVariability()
   * @generated
   * @ordered
   */
  protected String variability = VARIABILITY_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ArtifactElementImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ProcessDslPackage.Literals.ARTIFACT_ELEMENT;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Artifact getArtifacts()
  {
    if (artifacts != null && artifacts.eIsProxy())
    {
      InternalEObject oldArtifacts = (InternalEObject)artifacts;
      artifacts = (Artifact)eResolveProxy(oldArtifacts);
      if (artifacts != oldArtifacts)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS, oldArtifacts, artifacts));
      }
    }
    return artifacts;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Artifact basicGetArtifacts()
  {
    return artifacts;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setArtifacts(Artifact newArtifacts)
  {
    Artifact oldArtifacts = artifacts;
    artifacts = newArtifacts;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS, oldArtifacts, artifacts));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getPinType()
  {
    return pinType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setPinType(String newPinType)
  {
    String oldPinType = pinType;
    pinType = newPinType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ProcessDslPackage.ARTIFACT_ELEMENT__PIN_TYPE, oldPinType, pinType));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getVariability()
  {
    return variability;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setVariability(String newVariability)
  {
    String oldVariability = variability;
    variability = newVariability;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ProcessDslPackage.ARTIFACT_ELEMENT__VARIABILITY, oldVariability, variability));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS:
        if (resolve) return getArtifacts();
        return basicGetArtifacts();
      case ProcessDslPackage.ARTIFACT_ELEMENT__PIN_TYPE:
        return getPinType();
      case ProcessDslPackage.ARTIFACT_ELEMENT__VARIABILITY:
        return getVariability();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS:
        setArtifacts((Artifact)newValue);
        return;
      case ProcessDslPackage.ARTIFACT_ELEMENT__PIN_TYPE:
        setPinType((String)newValue);
        return;
      case ProcessDslPackage.ARTIFACT_ELEMENT__VARIABILITY:
        setVariability((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS:
        setArtifacts((Artifact)null);
        return;
      case ProcessDslPackage.ARTIFACT_ELEMENT__PIN_TYPE:
        setPinType(PIN_TYPE_EDEFAULT);
        return;
      case ProcessDslPackage.ARTIFACT_ELEMENT__VARIABILITY:
        setVariability(VARIABILITY_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ProcessDslPackage.ARTIFACT_ELEMENT__ARTIFACTS:
        return artifacts != null;
      case ProcessDslPackage.ARTIFACT_ELEMENT__PIN_TYPE:
        return PIN_TYPE_EDEFAULT == null ? pinType != null : !PIN_TYPE_EDEFAULT.equals(pinType);
      case ProcessDslPackage.ARTIFACT_ELEMENT__VARIABILITY:
        return VARIABILITY_EDEFAULT == null ? variability != null : !VARIABILITY_EDEFAULT.equals(variability);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (pinType: ");
    result.append(pinType);
    result.append(", variability: ");
    result.append(variability);
    result.append(')');
    return result.toString();
  }

} //ArtifactElementImpl
